﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using WF = System.Windows.Forms;
using WPF = System.Windows.Controls;
namespace An_Im.UI
{
    public partial class AnImWPFElementControl : WF.UserControl
    {
        public WPF.UserControl WPFUserControl { get; private set; }

        public AnImWPFElementControl()
        {
            InitializeComponent();
        }

        public void SetWPFContent(WPF.UserControl usercontrol)
        {
            WPFUserControl = usercontrol;
            elementHost1.Child = usercontrol;

        }


        /// <summary>
        /// 创建含WPF成员的控件。
        /// </summary>
        static public AnImWPFElementControl CreateControl(WPF.UserControl usercontrol)
        {
            var elemcontrol = new AnImWPFElementControl();
            elemcontrol.elementHost1.Child = usercontrol;
            elemcontrol.WPFUserControl = usercontrol;
            
            return elemcontrol;
        }

        /// <summary>
        /// 创建含WPF成员的控件。
        /// </summary>
        static public AnImWPFElementControl CreateControl2(WPF.UserControl usercontrol)
        {
            var elemcontrol = new AnImWPFElementControl();
            elemcontrol.elementHost1.Child = usercontrol;
            elemcontrol.WPFUserControl = usercontrol;
            return elemcontrol;
        }

    }
}
